<?php

namespace app\web\command;

use app\common\util\Tools;
use think\console\Input;
use think\console\Output;
use think\facade\Log;

class HomeTest extends CommonTest
{

    //再命令窗口中执行“php think interfaceWeb-Home”
    protected function configure()
    {
        $this->setName('interfaceWeb-Home')
            ->setDescription('接口测试');
    }

    public function execute(Input $input, Output $output)
    {
        parent::execute($input, $output);

        //Route::any('web/home/indexData', 'web/home/getHomeData');                                                               // 首页数据
        $data = Tools::curl($this->url . "web/home/indexData", json_encode(["token" => "$this->token"]));
        Log::write("post". var_export($data,true));
        echo $data . "\n\n";
    }
}
